package com.jinghua.treatment.service.impl;

import com.jinghua.treatment.entity.SysClinic;
import com.jinghua.treatment.mapper.SysClinicMapper;
import com.jinghua.treatment.service.SysClinicService;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import javax.annotation.Resource;
import java.util.Date;
import java.util.List;

/**
 * Created by 王兴光 on 2018/4/18.
 */
@Service("clinicService")
public class SysClinicServiceImpl implements SysClinicService {

    @Resource
    private SysClinicMapper clinicMapper;

    @Override
    public int deleteByPrimaryKey(Integer clinicId) {
        return clinicMapper.deleteByPrimaryKey(clinicId);
    }

    @Override
    public int insert(SysClinic record) {
        record.setClinicCreatedate(new Date());
        return clinicMapper.insert(record);
    }

    @Override
    public SysClinic selectByPrimaryKey(Integer clinicId) {
        return null;
    }

    @Override
    public List<SysClinic> selectById(Integer clinicId) {
        return clinicMapper.selectListByDoctorId(clinicId);
    }

    @Override
    public List<SysClinic> selectByDoctorId(Integer doctorId) {
        return clinicMapper.selectByDoctorId(doctorId);
    }

    @Override
    @Transactional
    public int updateByPrimaryKey(SysClinic record) {
        return clinicMapper.updateByPrimaryKey(record);
    }


    public void addClinic(SysClinic record) {

    }
}
